<template>
    <el-form :model="formData" label-width="240px"> 
      <el-form-item label='商城名称' prop="shopping_mall_name">
        <el-input v-model="formData.shopping_mall_name"></el-input>
      </el-form-item>
      <el-form-item label="商城地址" prop="shopping_mall_adress">
        <el-input v-model="formData.shopping_mall_adress"></el-input>
      </el-form-item>
      <el-form-item label='联系电话' prop="shopping_mall_phone">
        <el-input v-model="formData.shopping_mall_phone"></el-input>
      </el-form-item>
      <el-form-item label="联系QQ" prop="shopping_mall_qqc">
        <el-input v-model="formData.shopping_mall_qq"></el-input>
      </el-form-item>
      <el-form-item style="display: flex;justify-content: flex-end;margin-top: 10px">
        <el-button @click="add">确定</el-button>
        <el-button @click="reset">重值</el-button>
      </el-form-item>
    </el-form>
</template>
  
<script>
import axios from 'axios'
export default {
  name: 'shopMallInfoConfig',
  componentTitle: '商城信息配置',
  data () {
    return {
      formData:{
        shopping_mall_name:'',
        shopping_mall_adress:'',
        shopping_mall_phone:'',
        shopping_mall_qq:''
      }
    }
  },
  methods:{
    reset(){
    },
    add(){
      axios({
        url:'http://192.168.200.251:8888/admin/config/mall',
        method:'get',
        data:{
          shopping_mall_name:this.formData.shopping_mall_name,
          shopping_mall_adress:this.formData.shopping_mall_adress,
          shopping_mall_phone:this.formData.shopping_mall_phone,
          shopping_mall_qq:this.formData.shopping_mall_qq
        },
        headers:{
          'Shopping-Admin-Token': sessionStorage.getItem('Shopping-Admin-Token')
        }
      }).then(res=>{
        if(res.data.errno === 0){
          this.$notify.success({title:'修改成功'})
        }else{
          this.$notify.error({title:'修改失败'})
        }
      })
    }
  }
}
</script>

